package spotGUI.utils;

import javax.swing.JList;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

import personalProfile.PersonalProfile;
import utils.SocialUserData;



public class SocialUserSelectionListener implements ListSelectionListener {

	@Override
	public void valueChanged(ListSelectionEvent e) {
		if (((JList)e.getSource()).getSelectedValue() != null && !e.getValueIsAdjusting()) {
			SocialUserData user = (SocialUserData) ((JList)(e.getSource())).getSelectedValue();
			new PersonalProfile(user.getUserId());
			((JList)e.getSource()).clearSelection();
		}
	}

}
